package com.refactor.practice.movieType.type;

import com.refactor.practice.movieType.MovieType;

public class Regular extends MovieType {

    private Regular() {
    }


    @Override
    public Double getPrice() {
        return 2D;
    }



    public static enum RegularEnum {
        INCTANCE;
        private Regular inctance = null;
        private RegularEnum() {
            inctance = new Regular();
        }

        public Regular getInctance() {
            return inctance;
        }
    }


    public static MovieType getInctance() {
        return RegularEnum.INCTANCE.getInctance();
    }

    @Override
    public Double getAmount(int daysRented) {
        if (daysRented > 2) {
            return (daysRented - 2) * getPrice() + 1.5D;
        } else {
            return 1.5D;
        }
    }

    @Override
    public int getFrequentRenterPoints(int daysRented) {
        return (daysRented > 1) ? 2 : 1;
    }
}
